package learnonline.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import learnonline.dao.StudentDao;
import learnonline.dao.UserDao;
import learnonline.dao.impl.StudentDaoImpl;
import learnonline.dao.impl.UserDaoImpl;
import learnonline.entity.Student;
import learnonline.entity.User;

@WebServlet("/userdetail")
public class UserImformationServlet extends HttpServlet{
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	StudentDao studentdao = new StudentDaoImpl();
	String sname =(String) request.getSession().getAttribute("username"); 
	System.out.println(sname);
	Student student =studentdao.fetchStudentBy(sname);
	request.setAttribute("student", student);
	request.getRequestDispatcher("/userdetail.jsp").forward(request, response);
	}
}
